﻿
@{
    ViewBag.Title = "UpdateExecForm";
    Layout = "~/Views/Shared/_Form.cshtml";
}

<script>
    var keyValue = $.request("keyValue");
    var f = $.request("from");
    $(function () {
        $("#zlsgh").bindSelect({
            url: "/SystemManage/Staff/GetStaffByDutyCode?dutyCode=" + "RehabDoctor",
            id: "StaffGh",
            text: "StaffName"
        });

        //加载康复类别
        $("#kflb").bindSelect({
            url: "/Com/GetSelectItemsDetailListByItemCode?code=RehabTreatmentMethod",
        });

        if (!!keyValue) {
            $.najax({
                type: "POST",
                async: false,
                url: "@Url.Action("GetFormJson")",
                data: { keyValue: keyValue, from: f },
                dataType: "json",
                cache: false,
                success: function (data) {
                    if (data) {
                        $("#form1").formSerialize(data);
                        $('#zlsgh').val(data.zlsgh).trigger('change');
                        $('#kflb').val(data.kflb).trigger('change');
                        $('#zxrq').val(data.zlrq.substring(0, 10));
                    }
                }
            });
        }

    });

    function submitForm(callback) {
        if (!$('#form1').formValid()) {
            return false;
        }
        var data = {};
        var zxitem = {};
        var zxsj = $('#zxrq').val();
        var zlsgh = $('#zlsgh').val();
        var kflb = $('#kflb').val();
        if (keyValue && zxsj && zlsgh && kflb) {
            zxitem = { zxId: keyValue, zxsj: zxsj, zlsgh: zlsgh, kflb: kflb };
        }
        data["zxitem"] = zxitem;
        data.from = f;
        $.submitForm({
            url: "@Url.Action("updateExc")",
            param: data,
            success: function () {
                callback();
            }
        });
    }
</script>
<form id="form1">
    <table class="form" style="margin-top: 10px; width: 95%">
        <tr>
            <td class="formTitle">治疗日期：</td>
            <td class="formValue">
                <input id="zxrq" value="@(DateTime.Now.ToString("yyyy-MM-dd"))" type="text" class="form-control input-wdatepicker" onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd'})" />
            </td>
            <th class="formTitle">治疗师：</th>
            <td class="formValue formDdlSelectorTd">
                <select id="zlsgh" name="zlsgh" class="form-control">
                    <option value="">==请选择==</option>
                </select>
        </tr>
        <tr>
            <th class="formTitle">康复类别：</th>
            <td class="formValue">
                <select id="kflb" name="kflb" class="form-control">
                    <option value="">==请选择==</option>
                </select>
            </td>
            <th class="formTitle">收费项目：</th>
            <td class="formValue">
                <input type="text" class="form-control newtouch_Readonly" id="sfxmmc" />
            </td>

        </tr>
        <tr>
            <th class="formTitle">患者姓名：</th>
            <td class="formValue">
                <input type="text" class="form-control newtouch_Readonly" id="xm" />
            </td>
            <th class="formTitle">治疗量：</th>
            <td class="formValue">
                <input type="text" class="form-control newtouch_Readonly" id="zll" />
            </td>
        </tr>
        <tr>

            <th class="formTitle">数量：</th>
            <td class="formValue">
                <input type="text" class="form-control newtouch_Readonly" id="sl" />
            </td>
            <th class="formTitle">单位：</th>
            <td class="formValue">
                <input type="text" class="form-control newtouch_Readonly" id="dw" />
            </td>
        </tr>
    </table>
</form>

